// McDlgServicePortSetting.cpp : implementation file
//

#include "stdafx.h"
#include "nodeclient.h"
#include "McDlgServicePortSetting.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// McDlgServicePortSetting dialog


McDlgServicePortSetting::McDlgServicePortSetting(CWnd* pParent /*=NULL*/)
	: CDialog(McDlgServicePortSetting::IDD, pParent)
{
	//{{AFX_DATA_INIT(McDlgServicePortSetting)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void McDlgServicePortSetting::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(McDlgServicePortSetting)
	DDX_Control(pDX, IDC_EDIT_PROXY_SERVICE_PORT, m_edit_Proxy_ServicePort);
	DDX_Control(pDX, IDC_IPADDRESS_PROXY_SERVICE, m_ipCtrl_Proxy_Service);
	DDX_Control(pDX, IDC_EDIT_NET_SERVICE_PORT, m_edit_Net_ServicePort);
	DDX_Control(pDX, IDC_IPADDRESS_NET_SERVICE, m_ipCtrl_Net_Service);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(McDlgServicePortSetting, CDialog)
	//{{AFX_MSG_MAP(McDlgServicePortSetting)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// McDlgServicePortSetting message handlers

void McDlgServicePortSetting::OnOK() 
{
	// TODO: Add extra validation here
	g_port_proxy = GetDlgItemInt(IDC_EDIT_PROXY_SERVICE_PORT);
	m_ipCtrl_Proxy_Service.GetAddress(g_addr0_proxy, g_addr1_proxy, g_addr2_proxy, g_addr3_proxy);
	g_port_net = GetDlgItemInt(IDC_EDIT_NET_SERVICE_PORT);
	m_ipCtrl_Net_Service.GetAddress(g_addr0_net, g_addr1_net, g_addr2_net, g_addr3_net);
	CDialog::OnOK();
}

BOOL McDlgServicePortSetting::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	SetDlgItemInt(IDC_EDIT_PROXY_SERVICE_PORT, g_port_proxy);
	m_ipCtrl_Proxy_Service.SetAddress(g_addr0_proxy, g_addr1_proxy, g_addr2_proxy, g_addr3_proxy);
	SetDlgItemInt(IDC_EDIT_NET_SERVICE_PORT, g_port_net);
	m_ipCtrl_Net_Service.SetAddress(g_addr0_net, g_addr1_net, g_addr2_net, g_addr3_net);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
